<?php
/**
 * Created by PhpStorm.
 * User: 陈阳
 * Date: 2021/1/30
 * Time: 8:36
 */
namespace app\admin\model;
use think\model;
class Gcategory extends Model
{
    public static function test(){
        $model = self::field(true);
        return $model->select();
    }
    public static function  fenleiList($data = []){

        if (!$data['id']){
          $list = self::where('parent_id',0)
          ->order('sort_order desc');
          return $list->select();
        }else{
            $list =  $list = self::where('parent_id',$data['id'])
                ->order('sort_order desc');
            return $list->select();
        }

    }
}